
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>
  <div>
    <h1>注册页面</h1>
    <table>
      <tr>
        <td>验证码：</td>
        <td>
          <input id="picCode" name="picCode" onblur="checkPicCode()"/>
        </td>
        <td>
          <img id="pic" src="PicCodeServlet" onclick="chagePicCode()">
          <span id="msgPicCode"></span>
        </td>
      </tr>
    </table>
  </div>
  </body>
  <script src="js/jquery.js"></script>
<script>
  //检查图片验证码
  function checkPicCode() {
    $.get("CheckPicCodeServlet?code="+$("#picCode").val(),function (data) {
      if(data=="true"){
        $("#msgPicCode").html("✔")
      }else {
        $("#msgPicCode").html("✘")
      }
    })
  }
  //切换验证码图片
  function chagePicCode() {
    $("#pic").attr("src","PicCodeServlet?temp="+new Date())
  }
</script>
</html>
